package com.springboot.blog.beans;


import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.time.LocalDateTime;

@Data
@NoArgsConstructor
public class SignIn implements Serializable {


    /**
     * 主键
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 签到用户名
     */
    @TableField(value = "user_name")
    private String  userName;

    /**
     * 连续签到天数
     */
    @TableField(value = "continue_days")
    private Integer continueDays;

    /**
     * 签到奖励
     */
    private Integer reward;

    /**
     * 会员名称
     */
    private String shopname;

    /**
     * 更新日期, 最后签到日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
    @TableField(fill = FieldFill.UPDATE,value = "update_times")
    private LocalDateTime updateTimes;

    public SignIn(String  userName,Integer continueDays,Integer reward, LocalDateTime updateTime) {
        this.userName = userName;
        this.updateTimes = updateTime;
        this.continueDays = continueDays;
        this.reward = reward;
    }
}